<template>
  <div>
    <h1>详情页</h1>
    <hr>
    <h1>参数:{{ $route.params.id }}</h1>
    <button @click="goBack">返回上一页</button>
  </div>
</template>
<script>
  export default {
    mounted(){
      console.log(this.$route.params.id);
    },
    methods:{
      goBack(){
        // 返回上一页
        this.$router.back()
      }
    }
  }
</script>

